/* eslint-disable react/no-unused-state */
/* eslint-disable react/sort-comp */
import { Component } from "react";
import { View, WebView } from '@tarojs/components'
import Taro, { getCurrentInstance } from '@tarojs/taro'

import { } from "taro-ui"
import './newDetail.scss'

export default class NewDateil extends Component {
  constructor() {
    super(...arguments)
    this.state = {
      href: ''
    }
  }


  componentWillMount () {
    this.getHref()
  }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  render () {
    return (
      <View className='newDateil'>
        <WebView src={this.state.href} />
      </View>
    )
  }
  getHref () {
    console.log(getCurrentInstance().router.params.index)
    let index = getCurrentInstance().router.params.index
    var href = Taro.getStorageSync('newList')[index].href
    // console.log(this);
    this.setState({
      href: href
    })
  }
}